<template>
    <section>
        <!--工具条-->
        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
            <el-form :inline="true" :model="filters">
                <el-form-item label="运营商" prop="operatoruid">
                    <el-select v-model="filters.operatoruid" collapse-tags clearable filterable placeholder="请选择运营商">
                        <el-option value="0" label="全部">全部</el-option>
                        <el-option
                                v-for="item in operator"
                                :key="item.operatoruid"
                                :label="item.operatorname"
                                :value="item.operatoruid">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item label="分销商" prop="useruuid"  v-show="isShow">
                    <el-select v-model="filters.useruuid" clearable filterable collapse-tags placeholder="请选择分销商" >
                        <el-option value="0" label="全部">全部</el-option>
                        <el-option
                                v-for="item in users"
                                :key="item.user.useruuid"
                                :label="item.user.username"
                                :value="item.user.useruuid">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="省份" prop="provinceuuid">
                    <el-select v-model="filters.provinceuuid" clearable filterable collapse-tags placeholder="请选择省份">
                        <el-option value="0" label="全部">全部</el-option>
                        <el-option
                                v-for="item in info"
                                :key="item.provinceuuid"
                                :label="item.provincename"
                                :value="item.provincename">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="业务类型" prop="busuuid"   v-show="isShow" >
                    <el-select v-model="filters.busuuid" filterable clearable  collapse-tags placeholder="请选择业务类型">
                        <el-option value="0" label="全部">全部</el-option>
                        <el-option
                                v-for="item in bus"
                                :key="item.busuuid"
                                :label="item.busname"
                                :value="item.busuuid">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item >
                    <el-input v-model="filters.downreqid" clearable="true" placeholder="商家订单号"   ></el-input>
                </el-form-item>
                <el-form-item>
                    <el-input v-model="filters.phoneNum" clearable="true" placeholder="手机号码"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-input v-model="filters.downfacevalue" clearable placeholder="面值"></el-input>
                </el-form-item>
                <!--<el-form-item>-->
                    <!--<el-input v-model="filters.downorderuuid"  placeholder="订单号"></el-input>-->
                <!--</el-form-item>-->
                <el-form-item label="订单状态"   >
                    <el-select v-model="filters.statu" filterable clearable collapse-tags placeholder="请选择订单状态">
                        <el-option value="0" label="全部">全部</el-option>
                        <el-option
                                v-for="item in status"
                                :key="item.id"
                                :label="item.name"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="回调状态"   >
                    <el-select v-model="filters.callstatus" filterable clearable  collapse-tags placeholder="请选择回调状态">
                        <el-option value="-1" label="全部">全部</el-option>
                        <el-option value="0" label="等待回调">等待回调</el-option>
                        <el-option value="1" label="回调成功">回调成功</el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-date-picker type="datetime" placeholder="开始时间"  format="yyyy-MM-dd HH:mm:ss"   v-model="filters.createtime" style="width: 100%;"></el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-date-picker type="datetime" placeholder="结束时间" clearable format="yyyy-MM-dd HH:mm:ss"   v-model="filters.endtime" style="width: 100%;"></el-date-picker>
                </el-form-item>
                <!--<el-form-item>-->
                    <!--<el-input v-model="filters.createtime" placeholder="创建时间"></el-input>-->
                <!--</el-form-item>-->
                <el-form-item>
                    <el-button type="primary" v-on:click="findDownOrder('')">{{buttonContent}}</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" v-show="isShow" v-on:click="findDownOrder('3')">3分钟未回调</el-button>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" v-show="isShow"  v-on:click="successOrderList">批量成功</el-button>
                </el-form-item>

<!--                <el-form-item>-->
<!--                    <el-button type="primary" v-show="isShow"  v-on:click="refundOrderList">批量退款</el-button>-->
<!--                </el-form-item>-->
                <el-form-item>
                    <el-button type="primary" v-show="isShow"  v-on:click="failtOrderList">批量失败</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" v-show="isShow"  v-on:click="statusCallBacks">批量回调</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" v-show="isShow" v-on:click="repeatFlowOrder"  >批量重提</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="exportdataFlowOrder">导出</el-button>
                </el-form-item>

<!--                <el-form-item>-->
<!--                    <el-button type="primary" @click="importFlowOrder">导入</el-button>-->
<!--                </el-form-item>-->
            </el-form>
        </el-col>

        <!--列表-->
        <el-table  :data="orders" highlight-current-row v-loading="listLoading"  :header-cell-class-name="tableRowClassName" max-height="620"  border  @selection-change="selsChange" style="width: 100%;">
            <el-table-column type="selection" width="55">
            </el-table-column>
            <el-table-column type="index" width="80" label="编号">
            </el-table-column>
            <el-table-column prop="userFlow.username" label="分销商" show-overflow-tooltip width="110px"   >
            </el-table-column>
            <el-table-column prop="operatorname" label="运营商" show-overflow-tooltip   width="100px" >
            </el-table-column>
            <el-table-column prop="province" label="省份" >
            </el-table-column>
            <el-table-column prop="cityName" label="地市">
            </el-table-column>
            <el-table-column prop="downShopProduct.businessType.busname"  width="120px" show-overflow-tooltip   label="业务类型">
                <template slot-scope="scope">
                    {{scope.row.downShopProduct ? scope.row.downShopProduct.businessType.busname : ''}}
                </template>
            </el-table-column>
            <el-table-column prop="dowonphonenum" label="充值号码" width="130px">
            </el-table-column>
            <el-table-column prop="rechargeamount" label="实际金额" width="120px">
            </el-table-column>
            <el-table-column prop="discountAmount" label="扣款金额" width="120px">
            </el-table-column>
            <el-table-column prop="downShopProduct.productName"  show-overflow-tooltip  width="140px" label="产品名称" >
            </el-table-column>
            <!--<el-table-column prop="downrechargenum" label="充值数量" width="120">-->
            <!--</el-table-column>-->
<!--            <el-table-column prop="downShopProduct.productName" label="产品名称" width="100px">-->
<!--            </el-table-column>-->
            <el-table-column prop="discount" width="90px" label="折扣" >
            </el-table-column>

            <el-table-column prop="downfacevalue"  width="100px" label="面值" :formatter="productType">
            </el-table-column>

            <el-table-column   prop="status" label="状态" width="100px"  :formatter="formatStatus">
            <template slot-scope="scope">
                <el-tag :type="scope.row.status == 2 ? 'success' : scope.row.status == 3 ?  'danger' : 'info'"   >{{scope.row.status === 1 ? '充值中' : scope.row.status === 2 ? '充值成功' : scope.row.status === 3 ? '充值失败' : scope.row.status === 4 ? "成功后取消的订单" :
                    scope.row.status === 5 ? "等待充值" :  scope.row.status === 6 ? "退款成功" :  scope.row.status === 7 ? "退款失败" :  scope.row.status === 8 ?
                    "失败后取消的订单" : scope.row.status === 9 ? "缓存订单" : scope.row.status === 10 ? "压单" :  scope.row.status === 11 ? "人工" : '未知' }} </el-tag>
            </template>
            </el-table-column>
            <el-table-column prop="callStatus"  width="100px"   label="回调状态"  :formatter="callStatus">
            </el-table-column>
            <!--<el-table-column prop="fastchargetype" label="快慢类型" width="120" :formatter="formatType">-->
            <!--</el-table-column>-->
            <el-table-column prop="createtime" width="170px" label="充值时间" >
            </el-table-column>
            <el-table-column prop="downendtime" width="170px" label="完成时间" >
            </el-table-column>
            <el-table-column prop="downShopProduct.downprouuid" label="产品编码" show-overflow-tooltip width="200px">
            </el-table-column>
            <el-table-column prop="downreqid" label="商家订单号" width="200px" show-overflow-tooltip>
            </el-table-column>
            <!--<el-table-column prop="downendtimesec" label="完成时间毫秒数">-->
            <!--</el-table-column>-->
            <!--<el-table-column prop="downreqnum" label="已轮训请求次数" width="140">-->
            <!--</el-table-column>-->
            <el-table-column prop="remark" label="备注" width="290px"  show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="statusremark" label="批次号" width="150px"  show-overflow-tooltip>
            </el-table-column>

            <el-table-column label="操作" v-if='isShow'   v-show="isShow"  fixed="right"  width="270px">
                <template scope="scope" v-show="isShow" >
                    <!--<el-button size="small" v-show="isShowSupper" @click="cancelOrder(scope.$index, scope.row)">取消订单-->
                    <!--</el-button>-->
<!--                    <el-button size="small" v-show="isShow" @click="refund(scope.$index, scope.row)">未到账退款-->
<!--                    </el-button>-->
                    <el-button size="small" v-show="isShow" @click="statusCallBack(scope.$index, scope.row)">状态回调
                    </el-button>

                    <el-button size="small" v-show="isShow" @click="failtOrder(scope.$index, scope.row)">充值失败
                    </el-button>

                    <el-button size="small" v-show="isShow" @click="successOrder(scope.$index, scope.row)">充值成功
                    </el-button>

                </template>
            </el-table-column>
        </el-table>

        <!--工具条-->
        <el-pagination
                @current-change="handleCurrentChange"
                @size-change="handleSizeChange"
                layout="total,sizes,prev, pager, next"
                :total="total">
        </el-pagination>


    </section>
</template>

<script>
    import util from '../../common/js/util'
    //import NProgress from 'nprogress'
    import {findDownOrder, manualCanelOrder, findAllBus,findAllPro,findAllDownShopInfo,testCanelOrder,getOperatorListPage,exportdataFlowOrder,statusCallBack,refundOrder,
        failtOrder,successOrder,refundOrderList,failtOrderList,successOrderList,repeatFlowOrder} from '../../api/api';
    import ElOption from "../../../node_modules/element-ui/packages/select/src/option.vue";
    import moment from 'moment';
    export default {
        components: {ElOption},
        data() {
            return {
                buttonContent:'查询',
                buttonContentLoading:false,
                filters: {
                    downreqid: '',
                    busuuid:'',
                    //createtime:  moment().subtract('days', 1).format('YYYY-MM-DD') + " 00:00:00",
                    createtime:  moment().subtract('hour', 1).format('YYYY-MM-DD HH:mm:ss'),
                    operatoruid:'',
                    endtime:'',
                    provinceuuid:'',
                    useruuid:'',
                    phoneNum:'',
                    downorderuuid:'',
                    statu:'',
                    callstatus:'',
                    downfacevalue:''
                },
                isShow: JSON.parse(sessionStorage.getItem("user")).usertype === 1 ? true : JSON.parse(sessionStorage.getItem("user")).usertype === 2 ? true : false,
                isShowSupper:JSON.parse(sessionStorage.getItem("user")).usertype === 2 ? true : false,
                orders: [],
//                1 充值中 2 充值成功 3充值失败  4成功后取消的订单  5订单达到  6退款成功 7 退款失败  8失败后取消的订单
                status:[{id:"1",name:"充值中",value:"1"},{id:"2",name:"充值成功",value:"2"} ,
                    {id:"3",name:"充值失败",value:"3"},
                    {id:"5",name:"等待充值",value:"5"},
                    {id:"9",name:"缓存订单",value:"9"},
                    {id:"10",name:"压单 ",value:"10"},{id:"11",name:"人工 ",value:"11"}],
                total: 0,
                start: 0,
                pageSize: 10,
                listLoading: false,
                bus: [],
                info:[],
                users:[],
                operator: [],
                sels: [],//列表选中列
            }
        },
        methods: {
            productType: function (row, column) {
                if(row.downShopProduct && row.downShopProduct.businessType){
                    return (row.downShopProduct.businessType.busname == "手机") ? (row.downShopProduct.downfacevalue + '话费') : ( row.downShopProduct.businessType.busname == "固话") ?  (row.downShopProduct.downfacevalue + '话费') :(row.downShopProduct.downfacevalue + 'M');
                }
                return "";
            },
            formatStatus: function (row, column) {
//                 状态 0 删除 1 充值中 2 充值成功 3充值失败  4成功后取消的订单  5订单达到  6退款成功 7 退款失败  8失败后取消的订单
                return row.status === 1 ? '充值中' : row.status === 2 ? '充值成功' : row.status === 3 ? "充值失败" : row.status === 4 ? "成功后取消的订单" :
                                row.status === 5 ? "等待充值" :  row.status === 6 ? "退款成功" :  row.status === 7 ? "退款失败" :  row.status === 8 ? "失败后取消的订单" : row.status === 9 ? "缓存订单": '未知';
            },
            tableRowClassName:function({row,column, rowIndex,cloumnIndex}) {
                console.log(row,rowIndex);
//                if (row.status === 3) {
//                    return 'warning-row';
//                } else if (rowIndex === 2) {
//                    return 'success-row';
//                }
//                 return '';
            },
            callStatus: function (row, column) {
//                  0等待回调中 1 回调成功 2 失败 3 下游也在使用此值  4 订单发送到上游失败  5发送订单到上游成功
                return row.callStatus === 1 ? '回调成功' : row.callStatus ===  0 ? '等待回调' : row.callStatus ===  2 ? "订单失败": '未知';
            },
            formatType: function (row, column) {
//                 快慢类型  1 快 0慢
                return row.fastchargetype == "1" ? '快充' : row.fastchargetype == "0" ? '慢充' : '未知';
            },
            cancelOrder: function (index, row) {
                if (row.status == "1" || row.status == "2" || row.status == "3" || row.status == "5") {
                    this.$confirm('确认取消该订单吗？订单电话号码:'+row.dowonphonenum, '提示', {}).then(() => {
                        let para = {
                            downorderuuid: row.downorderuuid
                        };
                        manualCanelOrder(para).then((datas) => {
                            this.listLoading = false;
                            let {message, code, data} = datas;
                            if (code !== "0") {
                                this.$message({
                                    message: message,
                                    type: 'error'
                                });
                            }
                            this.$message({
                                message: message,
                                type: 'info'
                            });
                            this.findDownOrder();
                        });
                    });
                } else {
                    const h = this.$createElement;
                    this.$message({
                        message: h('p', null, [
                            h('span', null, '失败的订单不能取消! '),
                        ])
                    });
                }
            },
            statusCallBack:function (index, row) {
                this.$confirm('确认手工回调订单吗？订单电话号码:'+row.dowonphonenum, '提示', {}).then(() => {
                    let para = {
                        downorderuuid: row.downorderuuid
                    };
                statusCallBack(para).then((datas) => {
                        this.listLoading = false;
                        let {message, code, data} = datas;
                        if (code !== "0") {
                            this.$message({
                                message: message,
                                type: 'error'
                            });
                        }
                        this.$message({
                            message: message,
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                });
            },
            repeatFlowOrder(){
                if(this.sels != null  && this.sels.length > 0){
                    let str = "";
                    for(var i = 0 ; i < this.sels.length;i++){
                        str+= this.sels[i].dowonphonenum;
                    }
                    this.$confirm('确认批量重提订单吗？订单电话号码:'+str, '提示', {}).then(() => {
                        for(var i = 0 ; i < this.sels.length;i++){
                            let para = {
                                downorderuuid: this.sels[i].downorderuuid
                            };
                            repeatFlowOrder(para).then((datas) => {
                                this.listLoading = false;
                                let {message, code, data} = datas;
                                if (code !== "0") {
                                    this.$message({
                                        message: message,
                                        type: 'error'
                                    });
                                }
                            });
                        }
                        this.findDownOrder();
                    });
                }else{
                    this.$message({
                        message: "请选择订单",
                        type: 'error'
                    });
                }
            }
            ,statusCallBacks:function () {
                if(this.sels != null  && this.sels.length > 0){
                    let str = "";
                    for(var i = 0 ; i < this.sels.length;i++){
                        str+= this.sels[i].dowonphonenum;
                    }
                    this.$confirm('确认批量回调订单吗？订单电话号码:'+str, '提示', {}).then(() => {
                        for(var i = 0 ; i < this.sels.length;i++){
                            let para = {
                                downorderuuid: this.sels[i].downorderuuid
                            };
                            statusCallBack(para).then((datas) => {
                                this.listLoading = false;
                                let {message, code, data} = datas;
                                if (code !== "0") {
                                    this.$message({
                                        message: message,
                                        type: 'error'
                                    });
                                }
                            });
                        }
                        this.$message({
                            message: "回调成功",
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                }else{
                    this.$message({
                        message: "请选择订单",
                        type: 'error'
                    });
                }
            },refund:function(index, row){
                this.$confirm('确认退款该订单吗？订单电话号码:'+row.dowonphonenum, '提示', {}).then(() => {
                    let para = {
                        downorderuuid: row.downorderuuid
                    };
                    refundOrder(para).then((datas) => {
                        this.listLoading = false;
                        let {message, code, data} = datas;
                        if (code !== "0") {
                            this.$message({
                                message: message,
                                type: 'error'
                            });
                        }
                        this.$message({
                            message: message,
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                });
            },refundOrderList:function(){
                if(this.sels != null  && this.sels.length > 0){
                    let str = "";
                    for(var i = 0 ; i < this.sels.length;i++){
                        str+= this.sels[i].dowonphonenum;
                    }
                    this.$confirm('确认批量退款订单吗？订单电话号码:'+str, '提示', {}).then(() => {
                        let para = {
                            downorderuuids: this.sels
                        };
                        refundOrderList(para).then((datas) => {
                            this.listLoading = false;
                            let {message, code, data} = datas;
                            if (code !== "0") {
                                this.$message({
                                    message: message,
                                    type: 'error'
                                });
                            }
                            this.$message({
                                message: message,
                                type: 'info'
                            });
                            this.findDownOrder();
                        });
                    });
                }else{
                    this.$message({
                        message: "请选择订单",
                        type: 'error'
                    });
                }
            },failtOrderList:function(){
                if(this.sels != null  && this.sels.length > 0){
                    let str = "";
                    for(var i = 0 ; i < this.sels.length;i++){
                        str+= this.sels[i].dowonphonenum;
                    }
                    this.$confirm('确认批量失败订单吗？订单电话号码:'+str, '提示', {}).then(() => {
                        let para = {
                            downorderuuids: this.sels
                        };
                        failtOrderList(para).then((datas) => {
                            this.listLoading = false;
                            let {message, code, data} = datas;
                            if (code !== "0") {
                                this.$message({
                                    message: message,
                                    type: 'error'
                                });
                            }
                            this.$message({
                                message: message,
                                type: 'info'
                            });
                            this.findDownOrder();
                        });
                    });
                }else{
                    this.$message({
                        message: "请选择订单",
                        type: 'error'
                    });
                }
            },
            failtOrder:function (index, row) {
                this.$confirm('确认手工失败订单吗？订单电话号码:'+row.dowonphonenum, '提示', {}).then(() => {
                    let para = {
                        downorderuuid: row.downorderuuid
                    };
                    failtOrder(para).then((datas) => {
                        this.listLoading = false;
                        let {message, code, data} = datas;
                        if (code !== "0") {
                            this.$message({
                                message: message,
                                type: 'error'
                            });
                        }
                        this.$message({
                            message: message,
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                });
            },
            successOrder:function (index, row) {
                this.$confirm('确认手工成功订单吗？订单电话号码:'+row.dowonphonenum, '提示', {}).then(() => {
                    let para = {
                        downorderuuid: row.downorderuuid
                    };
                    successOrder(para).then((datas) => {
                        this.listLoading = false;
                        let {message, code, data} = datas;
                        if (code !== "0") {
                            this.$message({
                                message: message,
                                type: 'error'
                            });
                        }
                        this.$message({
                            message: message,
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                });
            },successOrderList:function () {
                let str = "";
                for(var i = 0 ; i < this.sels.length;i++){
                    str+= this.sels[i].dowonphonenum;
                }
                this.$confirm('确认手工批量成功订单吗？订单电话号码:'+str, '提示', {}).then(() => {
                    let para = {
                        downorderuuids: this.sels
                    };
                    successOrderList(para).then((datas) => {
                        this.listLoading = false;
                        let {message, code, data} = datas;
                        if (code !== "0") {
                            this.$message({
                                message: message,
                                type: 'error'
                            });
                        }
                        this.$message({
                            message: message,
                            type: 'info'
                        });
                        this.findDownOrder();
                    });
                });
            },findAllBus: function () {
                let para = {useruuid: ''};
                findAllBus(para).then(datas => {
                    let {message, code, data} = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        this.bus = data;
                    }
                });
            },
            findAllPro:function(){
                let para = {useruuid: ''};
                findAllPro(para).then(datas => {
                    let {message, code, data} = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        this.info = data;
                    }
                });
            },
            findAllDownShopInfo:function(){
                let para = {useruuid: JSON.parse(sessionStorage.getItem("user")).useruuid};
                findAllDownShopInfo(para).then(datas => {
                    let {message, code, data} = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        if(data){
                            this.users = data;
                        }
                    }
                });
            },
            findDownOrder(minute) {
                this.buttonContentLoading = true;
                this.buttonContent = "查询";
                let para = {
                    start: this.start,
                    pageSize: this.pageSize,
                    useruuid:this.filters.useruuid == "0" ? "": this.filters.useruuid, //JSON.parse(sessionStorage.getItem("user")).useruuid,
                    busuuid:this.filters.busuuid == "0" ? "" : this.filters.busuuid,
                    provinceuuid:this.filters.provinceuuid == "0" ? "" : this.filters.provinceuuid,
                    operatoruid:this.filters.operatoruid == "0" ? "" : this.filters.operatoruid,
                    downreqid:this.filters.downreqid,
                    phoneNum:this.filters.phoneNum,
                    downorderuuid:this.filters.downorderuuid,
                    status : this.filters.statu == "0" ? "" : this.filters.statu,
                    createtime: (this.filters.createtime == "" || this.filters.createtime == undefined) ? "" : moment(this.filters.createtime,"YYYY-MM-DD HH:mm:ss").format('YYYY-MM-DD HH:mm:ss'),
                    endtime: (this.filters.endtime == "" || this.filters.endtime == undefined) ? "" : moment(this.filters.endtime,"YYYY-MM-DD HH:mm:ss").format('YYYY-MM-DD HH:mm:ss'),
                    callstatus:this.filters.callstatus == "-1" ? "" : this.filters.callstatus,
                    downfacevalue:this.filters.downfacevalue
                };
                if(minute){
                    para.minute = true;
                    para.createtime = "";
                }
                findDownOrder(para).then((datas) => {
                    this.buttonContent = "查询";
                    this.buttonContentLoading = false;
                    this.listLoading = false;
                    let {message, code, data} = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        this.orders = data.result;
                        this.total = data.totalCount;
                    }
                }).catch( error => {
                    this.buttonContent = "查询";
                    this.buttonContentLoading = false;
                });
            }, exportdataFlowOrder:function () {
                let para = {
                    useruuid:this.filters.useruuid == "0" ? "": this.filters.useruuid, //JSON.parse(sessionStorage.getItem("user")).useruuid,
                    busuuid:this.filters.busuuid == "0" ? "" : this.filters.busuuid,
                    provinceuuid:this.filters.provinceuuid == "0" ? "" : this.filters.provinceuuid,
                    operatoruid:this.filters.operatoruid == "0" ? "" : this.filters.operatoruid,
                    downreqid:this.filters.downreqid,
                    phoneNum:this.filters.phoneNum,
                    downorderuuid:this.filters.downorderuuid,
                    status : this.filters.statu == "0" ? "" : this.filters.statu,
                    createtime: (!this.filters.createtime || !this.filters.createtime) ? "" : moment(this.filters.createtime,"YYYY-MM-DD HH:mm:ss").format('YYYY-MM-DD HH:mm:ss'),
                    endtime: this.filters.endtime == "" ? "" : moment(this.filters.endtime,"YYYY-MM-DD HH:mm:ss").format('YYYY-MM-DD HH:mm:ss'),
                    callstatus:this.filters.callstatus == "-1" ? "" : this.filters.callstatus,
                    downfacevalue:this.filters.downfacevalue
                };
                exportdataFlowOrder(para).then(res => {
                    let {message, code, data} = res;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else {
                        if(data.path){
                            this.$message({
                                message: "订单导出成功,请稍后进入导出列表下载",
                                type: 'info'
                            });
                        }
                    }
                });
            },handleCurrentChange: function (val) {
                this.start = val -1;
                this.findDownOrder();
            },handleSizeChange: function (val) {
                this.pageSize = val;
                this.findDownOrder();
            },getOperatorListPage() {
                let para = {
                    start: 1,
                    pageSize:10,
                    operatorname:'',
                };
                this.listLoading = true;
                getOperatorListPage(para).then((datas) => {
                    let { message, code, data } = datas;
                    if (code !== "0") {
                        this.$message({
                            message: message,
                            type: 'error'
                        });
                    } else if(data && data.result) {
                        this.operator = data.result;
                    }
                });
            },selsChange: function (sels) {
                this.sels = sels;
            },importFlowOrder:function () {

            }
        },
        async mounted() {
            if(this.isShow){
                await this.findAllDownShopInfo();
            }
            await this.findDownOrder();
        },
        async created(){
            await this.findAllPro();
            await this.findAllBus();
            await this.getOperatorListPage();
        }
    }

</script>

<style scoped>

</style>
